import React, { useState, useEffect } from 'react'

export default function Test() {
  const [a, setA] = useState(0)
  console.log('test组件结构体中打印', a)

  useEffect(() => {
    console.log('test组件挂载/更新', a)
  }, [])

  return (
    <div>
      <p>{a}</p>
      <button
        onClick={() => {
          setA(8)
        }}
      >
        按钮
      </button>
    </div>
  )
}
